package practice;

public class StopWatch {
	private StopWatch() {
		startNS = System.nanoTime();
	}
	
	private long startNS;
	
	public static StopWatch createStarted() {
		StopWatch sw = new StopWatch();		
		return sw;
	}
	
	public long milliSecondsElapsed() {
		long endNS = System.nanoTime();
		
		int ms = Math.round((endNS - startNS) / 1000000);
		
		return ms;
	}
	
	public long nanoSecondsElapsed() {
		return System.nanoTime() - startNS;
	}
}
